package polymorphic;

public class Test {
    public static void eat(Son son){
        son.eat();
    }
    public static void main(String[] args) {
        //1.
//        Son son = new Son();
//        son.eat();
//        son = new XiaoTang();
//        son.eat();
//        son = new Yuanyuan();
//        son.eat();
        //2.引用作为方法的参数
        eat(new Son());
        eat(new Yuanyuan());
        eat(new XiaoTang());
    }
}
